import React, {useState} from 'react'
import {View,Text,Radio,RadioGroup} from '@tarojs/components'
import { AtForm, AtInput, AtButton, AtRadio } from 'taro-ui'
import './addPerson.scss'
import Taro from "@tarojs/taro";

function addPerson () {

  let handleChange =  (value)=> {
  console.log(value)
  }
  let onSubmit =  (event)=> {
    console.log(this.state.value)
  }
  let onReset =  (event)=> {
    this.setState({
      value: '',
    })
  }

  let sure = ()=>{
    Taro.navigateTo({
      url: '/pages/YXX/finishPay/finishPay'
    })
  }

  return (
    <View className='add_person_container'>
      <AtForm
        onSubmit={onSubmit}
        onReset={onReset}
      >
        <AtInput
          name='name'
          title='姓名'
          type='text'
          placeholder='输入体检人真实姓名[必填]'
          onChange={handleChange}
          value="123"
        />
        <AtInput
          name='phone'
          title='手机号码'
          type='text'
          placeholder='[必填]'
          value="123"
          onChange={handleChange}
        />
        <View className="radios">
          <Text className="radios_title">婚否</Text>
          <RadioGroup >
            <Radio value='已婚' checked color="#0075ff">已婚</Radio>
            <Radio style='margin-left: 20rpx' stylevalue='未婚' color="#0075ff">未婚</Radio>
          </RadioGroup>
        </View>
        <AtInput
          name='idCard'
          title='身份证号'
          type='text'
          placeholder='输入正确的身份证号[必填]'
          value="123"
          onChange={handleChange}
        />
        <AtInput
          name='idCard'
          title='生日'
          type='text'
          placeholder='选择生日'
          value="123"
          onChange={handleChange}
        />
        <View className="radios">
          <Text className="radios_title">性别</Text>
          <RadioGroup >
            <Radio value='男' checked color="#0075ff">男</Radio>
            <Radio style='margin-left: 40rpx' stylevalue='女' color="#0075ff">女</Radio>
          </RadioGroup>
        </View>
      </AtForm>
      {/*按钮区域*/}
      <view className="sure_btn" onClick={sure}>
        <view>
          <text>保存</text>
        </view>
      </view>
    </View>
  )
}

export default addPerson
